<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/MebType.js此处编写
 -->
<template>
  <div>
    <view-grid
      ref="grid"
      :columns="columns"
      :detail="detail"
      :editFormFields="editFormFields"
      :editFormFileds="editFormFields"
      :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields"
      :searchFormFileds="searchFormFields"
      :searchFormOptions="searchFormOptions"
      :table="table"
      :extend="extend"
    >
    </view-grid>
  </div>
</template>

<script>
import extend from "@/extension/mall/Mebtype.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: "membertypeid",
        footer: "Foots",
        cnName: "会员类型",
        name: "MebType",
        url: "/MebType/",
        sortName: "createDate",
      },
      extend: extend,
      editFormFields: {createDate:'',parkID:'',createID:'',creator:'',modifier:'',modifyDate:'',typename:'',typecode:'',typealias:'',isnotice:'',notification:'',isnotice:'',isdisabled: 0,description:''},
      editFormOptions: [
        [
          {
            title: "类型名称",
            required: true,
            field: "typename",
            type: "text",
          },
          {
            title: "简称",
            required: true,
            field: "typealias",
            type: "text",
          },
        ],
        [
          {
            title: "类型代码",
            required: true,
            field: "typecode",
            type: "text",
          },
          {
            title: "通知模板",
            required: true,
            field: "notification",
            type: "text",
          },
        ],
        [
          {
            title: "是否通知",
            field: "isnotice",
            type: "switch",
            dataKey: "enable",
          },
          {
            title: "是否禁用",
            field: "isdisabled",
            type: "switch",
            dataKey: "enable",
          },
        ],
        [{ title: "无需预约", field: "parkID", type: "selectList",dataKey: 'mall_park',data: [] },
        { title: "描述", required: true, field: "description", type: "textarea" }],
      ],
      searchFormFields: {"typename":'',"typecode":""},
      searchFormOptions: [
        [{"title":"类型名称","field":"typename","type":"like"},{"title":"类型代码","field":"typecode","type":"like"}]
      ],
      columns: [
        {
          field: "typename",
          title: "类型名称",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "typecode",
          title: "类型代码",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "membertypeid",
          title: "会员类型编号",
          type: "int",
          width: 120,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true,
        },
        {
          field: "createID",
          title: "创建人ID",
          type: "int",
          width: 120,
          hidden: true,
          align: "left",
        },
        {
          field: "creator",
          title: "创建人",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "description",
          title: "描述",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true,
        },
        {
          field: "modifyID",
          title: "修改人ID",
          type: "int",
          width: 120,
          hidden: true,
          align: "left",
        },

      ],
      detail: {
        cnName:"会员等级",
        columns: [
          {
            field: "level",
            title: "等级名称",
            type: "datetime",
            width: 120,
            align: "left",
            edit:{type:'text'}
          },
          {
            field: "levelCode",
            title: "等级代码",
            type: "string",
            width: 120,
            align: "left",
            edit:{type:'text'}
          },
          {
            field: "isdisabled",
            title: "是否禁用",
            type: "string",
            width: 120,
            align: "left",
            edit:{type:'switch'}
          },
          {
            field: "description",
            title: "描述",
            type: "string",
            width: 120,
            align: "left",
            edit:{type:'text'}
          },
          {
            field: "",
            title: "操作",
            type: "string",
            width: 120,
            align: "left",
            render: (h, { row, column, index }) => {
              return h('a',{
                  on: {
                    click: (e) => {

                    }
                  }
                },'升级规则')
            }
          },
        ],
        sortName: "membertypeid",
        key:"levelid",
      }
    };
  },
};
export default vueParam;
</script>
